<template>
	<view class="">
		<view class="bgImg">
			<img :src="bannerUrl" alt="">
			<view class="btn" @click="invitation">
				<img src="/static/images/bgImgBtn.png" alt="">
			</view>
			<view class="content">
				<!-- container:邀请记录 -->
				每成功邀请一位好友成功注册即获得40元现金券，高不封顶好友注册成功并下单可获得60元现金券下单即可抵用!
				<!-- 1.用户可通过“亨亨到家APP-我的-邀请好友”进入互动页面，根据互动页面的提示邀请好友。<br />
				2邀请人在邀请链接成功发送至好友微信后7个自然日内完成注册，邀请人即可获得40元满减券被邀请人自受邀成功完成注册，在亨亨到家APP首次下单并完成服务后，邀请人即可获得60元满减券(即每邀请1位新用户，邀请人可得累计价值最高100元的优惠券)。<br />
				3.达成优惠券条件后，优惠券将在T+1日，即24小时后发放，自邀请人按规则完成邀请且被邀请人符合条件之日起算。<br />
				4.同一用户作为邀请人在活动期间不限邀请新用户数量<br />
				5.如用户存在违规行为 (包括但不限于以不正当手段获取利益以所获的权益进行盈利、刷单、虚假交易、机器作弊、批量注册、违背诚实信用等)，亨亨到家有权根据情节严重程度冠用户进行处罚，包括但不限于取消用户的参与资格、撤销相关违规交易、不予发放奖励、收回奖励，依法追究其法律责任等。<br />
				6.如出现不可抗力或情势变更的情况(包括但不限于重大灾害事件、活动受政府机关指令需要停止举办或调整、活动遭受严重网络攻击或因系统故障需要暂停举办的)，亨亨到家有权终止/中止活动。 -->
				<view class="list">
					<view class="list_item">
						邀请记录
					</view>
					<view class="list_item" v-for="(item,index) in list" :key="index">
						<view class="cover">
							<image :src="item.avatar" mode=""></image>
						</view>
						<view class="center">
							<view class="nickname">
								{{item.nickname[0]}}**
							</view>
							<view class="time">
								{{item.create_time}}
							</view>
						</view>
						<view class="coupon">
							{{item.coupon}}元现金券
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return{
				list:[
					{
						avatar:"https://thirdwx.qlogo.cn/mmopen/vi_32/BXUicHwMBFNwPnEM9f28ibqcyjuruTv4qN8uF1dFsfVtX1dxMItUpOagJf0x7ISNcalejibPSzibFpvq00Pc8iazvEQ/132",
						coupon:40,
						create_time:"2022-12-16 15:22:44",
						id:209,
						nickname:"陈轶",
					},
					{
						avatar:"https://thirdwx.qlogo.cn/mmopen/vi_32/BXUicHwMBFNwPnEM9f28ibqcyjuruTv4qN8uF1dFsfVtX1dxMItUpOagJf0x7ISNcalejibPSzibFpvq00Pc8iazvEQ/132",
						coupon:40,
						create_time:"2022-12-16 15:22:44",
						id:209,
						nickname:"陈轶",
					},
					{
						avatar:"https://thirdwx.qlogo.cn/mmopen/vi_32/BXUicHwMBFNwPnEM9f28ibqcyjuruTv4qN8uF1dFsfVtX1dxMItUpOagJf0x7ISNcalejibPSzibFpvq00Pc8iazvEQ/132",
						coupon:40,
						create_time:"2022-12-16 15:22:44",
						id:209,
						nickname:"陈轶",
					},
					{
						avatar:"https://thirdwx.qlogo.cn/mmopen/vi_32/BXUicHwMBFNwPnEM9f28ibqcyjuruTv4qN8uF1dFsfVtX1dxMItUpOagJf0x7ISNcalejibPSzibFpvq00Pc8iazvEQ/132",
						coupon:40,
						create_time:"2022-12-16 15:22:44",
						id:209,
						nickname:"陈轶",
					},
					{
						avatar:"https://thirdwx.qlogo.cn/mmopen/vi_32/BXUicHwMBFNwPnEM9f28ibqcyjuruTv4qN8uF1dFsfVtX1dxMItUpOagJf0x7ISNcalejibPSzibFpvq00Pc8iazvEQ/132",
						coupon:40,
						create_time:"2022-12-16 15:22:44",
						id:209,
						nickname:"陈轶",
					},
					{
						avatar:"https://thirdwx.qlogo.cn/mmopen/vi_32/BXUicHwMBFNwPnEM9f28ibqcyjuruTv4qN8uF1dFsfVtX1dxMItUpOagJf0x7ISNcalejibPSzibFpvq00Pc8iazvEQ/132",
						coupon:40,
						create_time:"2022-12-16 15:22:44",
						id:209,
						nickname:"陈轶",
					},
				],
				bannerUrl:''
			}
		},
		onLoad() {
			this.getList()
			this.getBanner()
		},
		methods:{
			getBanner(){
				this.$http({
					url:'/api/config',
					method:'get',
					success:result=>{
					console.log(result,'--------------------config')
						this.bannerUrl = result.data.banner_coupon
					}
				})
			},
			//分享
			invitation(){
				uni.navigateTo({
					url:'/pages/my/invitation/share'
				})
			},
			getList(){
				this.$http({
					url:'/api/user/invite_list?page=1&limit=5',
					method:'get',
					success:result=>{
						this.list = result.data.list
						console.log(result,'----------------------------list')
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.bgImg{
		width: 100%;
		>img{
			width: 100%;
			position: relative;
			height: 100%;
		}
		.btn{
			position: absolute;
			display: flex;
			flex-direction: column;
			align-items: center;
			width: 100%;
			top: 820rpx;
			>img{
				width: 64%;
				height: 58px;
			}
		}
		.content{
			width: 70%;
			margin: 0 auto;
			position: absolute;
			top: 1170rpx;
			left: 0;
			right: 0;
			color: #666;
			font-size: 23rpx;
			.list{
				margin-top: 30upx;
				.list_item{
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin: 15upx 0;
					.cover{
						width: 78upx;
						height: 78upx;
						>image{
							width: 100%;
							height: 100%;
							border-radius: 50%;
						}
					}
					.coupon{
						width: 25%;
					}
					.center{
						flex: 1;
						margin-left: 30upx;
					}
					>view{
						font-size: 12px;
					}
				}
			}
		}
	}
</style>